<?php 
//SPL标准库,方法是php中内置的
//1.栈 先进后出 Splstack()
$stack = new Splstack();
$stack->push('data1');//push()往里面放值
$stack->push('data2');
echo $stack->pop();//pop()弹出
echo "<br>";
echo $stack->pop();
echo "<hr>";
//2.队列  先进先出 SplQueue()
$queue = new SplQueue();
$queue->enqueue("data3");//enqueue()往里面放值
$queue->enqueue("data4");
echo $queue->dequeue();
echo "<br>";
echo $queue->dequeue();
echo "<hr>";
//3.堆 先进先出 SplMinHeap()
$heap = new SplMinHeap();
$heap->insert('data5');
$heap->insert('data6');
echo $heap->extract();
echo "<br>";
echo $heap->extract();
 ?>